<?php
require_once(dirname(__FILE__)."/../../include/fun.php");
$mcrypt_str='82h427sdi44sps';
$dir=base64_decode($_GET["dir"]); //解密地址

$file_name=iconv("utf-8",'gb2312',$_GET["name"]);//$_GET["name"] 是文件名
$path=$dir.$_GET["name"];//文件的完整路径
$path =iconv("utf-8",'gb2312',$path); 

if (!file_exists($path))   {   //检查文件是否存在  
	 echo   "文件找不到";  
	 exit;    
}else{  
	$file = fopen($path,"r"); // 打开文件

	Header("Content-type: application/octet-stream");	// 输入文件标签
	Header("Accept-Ranges: bytes");
	Header("Accept-Length: ".filesize($path));
	Header("Content-Disposition: attachment; filename=" . $file_name);  //保存的文件名
	
	echo fread($file,filesize($path));// 输出文件内容
	fclose($file);
	exit();
}
?>